#ifndef _PROCESS_ERROR_
#define _PROCESS_ERROR_

#define PROCESS_ERROR(__condition__)				\
	do												\
	{												\
		if (!(__condition__))						\
		{											\
			goto Exit0;								\
		}											\
	} while (0)			

#define PROCESS_SUCCESS(__condition__)				\
	do												\
	{												\
		if ((__condition__))						\
		{											\
			goto Exit1;								\
		}											\
	} while (0)			

#define LOG_PROCESS_ERROR(__condition__)			\
	do												\
	{												\
		if (!(__condition__))						\
		{											\
			goto Exit0;								\
		}											\
	} while(0)

#define LOG_CHECK_ERROR(__condition__)				\
	do												\
	{												\
		if (!(__condition__))						\
		{											\
		}											\
	} while(0)


#define SAFE_DELETE(__pointer__)					\
	do												\
	{												\
		if (__pointer__)							\
		{											\
			delete (__pointer__);					\
			(__pointer__) = NULL;					\
		}											\
	} while (0)

#define SAFE_DELETE_ARRAY(__pointer__)				\
	do												\
	{												\
		if (__pointer__)							\
		{											\
			delete [] (__pointer__);				\
			(__pointer__) = NULL;					\
		}											\
	} while (0)


#endif	// _PROCESS_ERROR_